from django import forms
from captcha.fields import CaptchaField
from .models import UserProfile

class LoginForm(forms.Form):
    username = forms.CharField(required=True,min_length=6)
    password = forms.CharField(required=True,min_length=8)
class RegisterForm(forms.Form):
    email = forms.CharField(required=True,min_length=6)
    password = forms.CharField(required=True, min_length=8)
    captcha = CaptchaField()#验证码验证
class PwdBackForm(forms.Form):
    email = forms.CharField(required=True,min_length=6)
    captcha = CaptchaField()  # 验证码验证
class EditInfoForm(forms.Form):
    nick_name = forms.CharField(required=True)

class UploadImageForm(forms.ModelForm):
    class Meta:
        model = UserProfile
        fields = ['image']
class AlterEmailForm(forms.Form):
    email = forms.CharField(required=True)
